<%-- 
    Document   : showCart
    Created on : May 23, 2014, 11:22:46 AM
    Author     : tuanna
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <form>
            <table border="1">
                <tr>
                    <th>Product ID
                    <th>Product Name
                    <th>Quantity
                    <th>Payment
                </tr>
                 <%
                        Cookie co[]=request.getCookies();
                        for(Cookie c: co){
                        if(c.getName().substring(0, 7).equals("product")){
                        String p[]=c.getValue().split("\\|");
                        String pid=p[0];
                        String pname=p[1];
                        String count=p[2];
                        String price=p[3];
                %>
                <tr>
                    <th><%=pid%>
                    <th><%=pname%>
                    <th><%=count%>
                    <th><%=price%>
                </tr>
                <%
                    }
                }
                %>
            </table>
        </form>
    </body>
</html>
